#ifndef ZONES_H_
#define ZONES_H_

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <map>

#include "segment.h"
#include "irrlicht.h"   // For vector3df
#include "graph/graph_directed.h"

using irr::core::vector3df;

/*! The zone class defines a basic zone for pathfinding, it just stores zone informations, and has exactly 0 or 4 points (verteces), an optionnal name and neightbours for the zone graph. */
class zone
{
	protected:
	std::vector<irr::core::vector3df> points__;		/**< A vector of exactly 0 or 4 points. */
	std::string name__;				   	/**< The name of the zone. */

	irr::core::plane3df plane__;				/**< The plane defining the zone. Only used in bdi-quest, not in way2go. */
	std::vector<int> seg_indexes__;				/**< The segments' indexes joined to the current zone. Only used in bdi-quest, not in way2go. */
	
	public:
	/*! Constructor. Does nothing. */
	zone();
	/*! Constructor. Copy constructor. */
	zone(const zone& zone_);
	/*! Destructor. Does nothing. */
	virtual ~zone();

	/*! Operator= . Just copies informations from zone_ to *this */
	zone& operator=(const zone& zone_);

	/*! Accessor. Returns the name of the zone. Note that it's not a const reference. */
	std::string& getName();

	/*! Accessor. Returns the vector of points. Note that it's not a const reference. */
	std::vector<irr::core::vector3df>& getPoints();

	/*! Calculates the plane defined by three of the points. */
	void calculatePlane();

	/*! Accessor. Returns the segments indexes to be used in bdi-quest. */
	std::vector<int>& getSegments();

	/*! Accessor. Returns the plane associated to the zone. */
	irr::core::plane3df& getPlane();

	friend bool operator== (const zone& z1, const zone& z2);
};


#endif

